var express = require('express');
var fs = require('fs');
var path = require('path')
var router = express.Router();

/* GET users listing. */
router.get('/', function(req, res, next) {
    res.send('respond with a resource');
});
/* GET home page. */
router.get('/list', function(req, res, next) {
    fs.readFile(path.join(__dirname, '../utils/goods.json'), function (err, data) {
        if (err) {
            return console.error(err);
        }

        var newData = JSON.parse(data)
        if (newData.status == 1) {
          console.log('家具asdasd')
        }
        res.json({
            status: "1",
            msg: "",
            result: newData.result
        })
    });
});

module.exports = router;
